-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Migrate scala3doc to compiler's parser #10462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate scala3doc to compiler's parser #10462
Conversation
a9a55ac
to
b7ca68f
Compare
"--projectTitle", ctx.settings.projectName.value, | ||
"--dest", ctx.settings.outputDir.value.toString, | ||
) | ||
val (filesToCompile, ctx) = setup(args, rootCtx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@romanowski this doesn't work, we need to parse the arguments ourselves first, then "forward" them to compiler settings. Otherwise the compiler will emit errors on Scala3doc-specific args. I can take a look at that later today.
f7373b3
to
454ecd7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks really good, I have only some small comments.
project/Build.scala
Outdated
@@ -1549,7 +1550,7 @@ object Build { | |||
if (dottyJars.isEmpty) Def.task { streams.value.log.error("Dotty lib wasn't found") } | |||
else generateDocumentation( | |||
roots, "Scala 3", "scala3doc/output/scala3-stdlib", "maser", | |||
"-p scala3doc/scala3-docs --syntax wiki --projectLogo scala3doc/scala3-docs/logo.svg " | |||
"-siteroot scala3doc/scala3-docs -comment-syntax wiki -projec-logo scala3doc/scala3-docs/logo.svg " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/projec-logo/project-logo
val pluginsDir: Setting[String] = StringSetting ("-Xpluginsdir", "path", "Path to search for plugin archives.", Defaults.scalaPluginPath) | ||
val pluginOptions: Setting[List[String]] = MultiStringSetting ("-P", "plugin:opt", "Pass an option to a plugin, e.g. -P:<plugin>:<opt>") | ||
|
||
/** Doctool specific settings */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we move these to Scala3doc
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is used by tastdoc so as long as it exisits we can't
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dottydoc, you mean? I guess then we should move it in a PR that deletes Dottydoc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok
use arguments extends of --tasty-root parameter
Use compiler reporter and provide our reporter for dokka Refactor how we handle arguments Unify sbt and cmd way to run documentation
Only use .tasty files
454ecd7
to
35f3e12
Compare
@nicolasstucki could you take a look at changes in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM.
* @param classes List of paths of `.tasty` and `.jar` files (no validation is performed) | ||
* @param classpath Classpath with extra dependencies needed to load class in the `.tasty` files | ||
*/ | ||
protected def inspectFilesInContext(classpath: List[String], classes: List[String])(using Context): Unit = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should hide this definition from the user-facing API, having it here just opens a can of worms we'd prefer to have closed.
How about:
- we make
inspectorDriver
private[inspector]
- we create
class DocTastyInspector extends TastyInspector
in pkgscala.tasty.inspector.internal
- we move this definition to said new class
- we use that class in the doctool instead of the usual inspector
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in: 2cd20e4
No description provided.